/*
 * JFrameHelp.java
 *
 * Created on 27 de junio de 2006, 20:33
 */

package fmap.gui.help;

import fmap.gui.help.JTreeHelp;
import fmap.utils.FormUtils;
import javax.swing.JScrollPane;

/**
 *
 * @author  javi
 */
public class JFrameHelp extends javax.swing.JFrame
{
    SimpleHelp simpleHelp = new SimpleHelp ("Ayuda - Fmap","web/node0.html");

    /** Creates new form JFrameHelp */
    public JFrameHelp ()
    {
        initComponents ();
        
        JTreeHelp jtree = new JTreeHelp (this);
        
        NodeTree n = new NodeTree ( "Fmap", "web/node0.html" );
        
        NodeTree[] aNodeTree = new NodeTree[2];
        NodeTree[] aSubNodeTree0 = new NodeTree[4];
        NodeTree[] aSubNodeTree1 = new NodeTree[4];

        aNodeTree[0] = new NodeTree ( "General", "web/node0.html");
        aSubNodeTree0[0] = new NodeTree ( "¿Para que sirve?", "web/node00.html");
        aSubNodeTree0[1] = new NodeTree ( "¿Como puedo organizar mis ficheros usando Fmap?", "web/node01.html" );
        aSubNodeTree0[2] = new NodeTree ( "Licencia", "web/node02.html" );
        aSubNodeTree0[3] = new NodeTree ( "Últimas noticias", "web/node03.html" );

        aNodeTree[0].setVSubNodes (aSubNodeTree0);
        
        aNodeTree[1] = new NodeTree ( "Ayuda Fmap", "web/node1.html");
        aSubNodeTree1[0] = new NodeTree ( "Coleciones (nueva,modificar,eliminar)", "web/node10.html" );
        aSubNodeTree1[1] = new NodeTree ( "Volumen (nuevo,modificar,eliminar)", "web/node11.html" );
        aSubNodeTree1[2] = new NodeTree ( "Buscar", "web/node12.html" );
        aSubNodeTree1[3] = new NodeTree ( "Iconos colecciones/volumenes", "web/node13.html" );

        aNodeTree[1].setVSubNodes (aSubNodeTree1);

        n.setVSubNodes (aNodeTree);
        
        
        TreeModelImpl treeModel = new TreeModelImpl (n);
        
        jtree.setModel (treeModel);
        jtree.expandTree ();
//        jtree.getSelectionModel ().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION);
//        jtree.setShowsRootHandles (true);
        
        jSplitPane1.setLeftComponent (jtree);
        

        JScrollPane htmlView = new JScrollPane ();
        htmlView.getViewport ().add (simpleHelp);

//        htmlView.setLocation (0,0);

        jSplitPane1.setRightComponent (htmlView);
        
//        this.addMouseListener ( new CloseAcercaDe( this ));
        FormUtils.centra (this);
        setVisible ( true );
    }

    public javax.swing.JSplitPane getJSplitPane()
    {
        return jSplitPane1;
    }
    
    public SimpleHelp getSimpleHelp ()
    {
        return simpleHelp;
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents()
    {
        jSplitPane1 = new javax.swing.JSplitPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Fmap - Ayuda");
        setAlwaysOnTop(true);
        jSplitPane1.setDividerLocation(250);
        jSplitPane1.setForeground(java.awt.Color.white);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 753, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JSplitPane jSplitPane1;
    // End of variables declaration//GEN-END:variables
    
}
